package com.mpyy.handler.purchase;

import com.mpyy.dao.ToolInter;
import com.mpyy.pojo.AgentiaType;
import com.mpyy.service.purchase.UpdateAgentiaTypeServiceInter;
import com.mpyy.tool.Tool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @version 1.0
 * @Descoription UpdateAgentiaTypeHandler
 * @Author CG
 * @date 2022-03-24
 */
@Controller
public class UpdateAgentiaTypeHandler {
    @Autowired
    @Qualifier(value = "updateAgentiaTypeServiceImpl")
    private UpdateAgentiaTypeServiceInter agentiaTypeServiceInter;
    @Autowired
    private ToolInter toolInter;
    @RequestMapping(value = "/updateAgentiaType")
    @ResponseBody
    public String updateAgentiaType(AgentiaType agentiaType){

        agentiaType.setAgentiaTypeId(new Tool().aotomaticId(agentiaType.getAgentiaTypeId(),toolInter));

        int row = agentiaTypeServiceInter.updateAgentiaType(agentiaType);

        return String.valueOf(agentiaType.getAgentiaTypeId());
    }

}


